
{extend name='../../admin/view/table'}

{block name="button"}
<button data-modal='{:url("add")}' data-offset="20" data-title="添加性别" class='layui-btn layui-btn-sm layui-btn-primary'>添加性别</button>
{/block}
{block name="content"}
<div class="think-box-shadow">
    <table id="oplog" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
</div>
{/block}
{block name='script'}
<script>
    $(function () {
        $('#oplog').layTable({
            even: true, height: 'full',
            sort: {field: 'sort asc,id', type: 'asc'},
            cols: [[
                // {checkbox: true},
                {field: 'sort', title: '排序权重', width: 100, align: 'center', sort: true, templet: '#SortInputTpl'},
                {field: 'id', title: 'ID', align: 'center'},
                {field: 'gender_name', title: '名称'},
                {field: 'create_at', title: '创建时间',align: 'center'},
                {toolbar: '#toolbar', title: '操作面板', align: 'center',minWidth: 150, fixed: 'right'}
            ]]
        });

    });

</script>
<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTpl">
    <input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
</script>
<script type="text/html" id="toolbar">
    <a class="layui-btn layui-btn-sm" data-title="编辑" data-offset="20" data-modal='{:url("edit")}?id={{d.id}}'>编 辑</a>
    <a data-action='{:url("remove")}' data-value="id#{{d.id}}" data-confirm="确认要删除这条记录吗？" class="layui-btn layui-btn-sm layui-btn-danger">删 除</a>

</script>
{/block}